<template>
    <!-- <Footer/> -->
    <!-- <CustomInput v-model:model="value"/> -->
    <!-- <h1>{{ value }}</h1> -->
    <div class="container">
        <background />

        <div class="login-container">
            <svg class="waves svg" viewBox="0 24 300 24" preserveAspectRatio="none">
                <defs>
                    <path id="wave" d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z" />
                </defs>
                <use class="wave" xlink:href="#wave" fill="#4579e2" x="50" y="0"></use>
                <g>
                    <use class="wave" xlink:href="#wave" fill="#4579e2" x="150" y="0"></use>
                    <use class="wave" xlink:href="#wave" fill="#3461c1" x="150" y="2"></use>
                    <use class="wave" xlink:href="#wave" fill="#2d55aa" x="150" y="4"></use>
                </g>
            </svg>
            <div class="inputbox">
                <h1>Welcome Back !</h1>
                <div class="input-item">
                    <span>账号</span>
                    <CustomInput v-model:model="form.username" placeholder="请输入账号" />
                </div>
                <div class="input-item">
                    <span>密码</span>
                    <CustomInput v-model:model="form.password" type="password" placeholder="请输入密码" />
                </div>
                <div class="login-btn-wrap">
                    <button class="login-btn">登录</button>
                </div>

            </div>
        </div>

    </div>
</template>

<script lang='ts' setup>
// import Footer from "./components/Footer.vue"

import CustomInput from './components/CustomInput.vue';
import { reactive } from 'vue';
import background from './components/background.vue';
import loginBackground from "./components/loginBackground.vue"
const form = reactive({
    username: "",
    password: ""

})
</script>

<style lang="less" scoped>
@background: #242424;
@textColor: #8685EF;
@normarlColor: #fff;
@loginWrapPaddingLeft: calc(100px + 10px);

.absoluteCenter {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

* {
    box-sizing: border-box;
}

.container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #242424;

    .login-container {
        width: 800px;
        height: 500px;
        background-color: #242424;
        box-shadow: rgba(0, 0, 0, 0.75) 0px 5px 15px 0px;
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
        transform: translateX(25%);

        .svg {
            z-index: 9;
            .absoluteCenter;
            transform: translate(-100%, -50%);
            width: 100%;
        }

        .inputbox {
            min-width: 800px;
            flex: 1;
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            background-color: inherit;
            padding-left: 50%;
            .absoluteCenter;

            h1 {
                color: @normarlColor;
                text-align: center;
                margin-bottom: 8%;
            }

            .input-item {
                display: flex;
                align-items: center;
                width: 100%;
                padding: 10px 15px;
                background-color: inherit;

                span {
                    min-width: 100px;
                    font-size: 18px;
                    text-align: center;
                    color: @textColor;
                    letter-spacing: 20px;
                    font-weight: bold;
                }
            }

            .input-item+.input-item {
                margin-top: 20px;
            }

            .login-btn-wrap {
                box-sizing: border-box;
                width: 100%;
                padding-left: @loginWrapPaddingLeft;
                display: flex;
                margin-top: 20%;

                .login-btn {
                    width: calc(100% - 10px);
                    height: 50px;
                    font-size: 18px;
                    letter-spacing: 20px;
                    outline: none;
                    background-color: @textColor;
                    color: @normarlColor;
                    cursor: pointer;
                }
            }
        }
    }
}

.waves {
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 1;

    .wave {
        animation: move 3s linear infinite;

        .loop (@index) when (@index > 0) {
            &:nth-child(@{index}) {
                animation-delay: unit(@index * -2, s);
                animation-duration: unit(12 - @index * 3, s);
            }

            .loop(@index - 1);
        }

        .loop(3); // 开始循环，从3开始

    }

    @keyframes move {
        from {
            transform: translate(-90px, 0%);
        }

        to {
            transform: translate(85px, 0%);
        }
    }
}


</style>